package com.etung.iot.demo.storage;

public enum SamplePeriodEnum {
    MIN_1(0,1,"1分钟"),
    MIN_5(1,5,"5分钟"),
    MIN_10(2,10,"10分钟"),
    MIN_30(3,30,"30分钟"),
    MIN_60(4,60,"60分钟");

    private int type;
    private int time;
    private String notes;

    SamplePeriodEnum(int type, int time, String notes) {
        this.type = type;
        this.time = time;
        this.notes = notes;
    }

    public static Integer getTimeByType(int type){
        for(SamplePeriodEnum item: SamplePeriodEnum.values()){
            if (item.getType() == type){
                return item.getTime();
            }
        }
        return 0;
    }

    public int getType() {
        return type;
    }

    public int getTime() {
        return time;
    }

    public String getNotes() {
        return notes;
    }
}
